Telegram Group & Telegram Channel
Что выведет следующий код на Python (модуль statistics)?


import statistics as stats
import math

data = [1, 2, 2, float('nan'), 3, 4]

print("Mean:", stats.mean(data))
print("Median:", stats.median(data))
print("Mode:", stats.mode(data))


🔢 Варианты ответа:

A)

Median: 2.5
Mode: 2


B)

Median: 2.5
Mode: 2


C)ValueError: nan is not a valid number


D)

Median: nan
Mode: 2


Правильный ответ: C

💡 Почему?
- Модуль
statistics не умеет работать с NaN.
-
stats.mean() и stats.median() вызовут StatisticsError или ValueError.
- В отличие от
numpy.nanmean, здесь всё падает.
📌 Подвох — в
float('nan') в списке.



tg-me.com/machinelearning_interview/1731
Create:
Last Update:

Что выведет следующий код на Python (модуль statistics)?


import statistics as stats
import math

data = [1, 2, 2, float('nan'), 3, 4]

print("Mean:", stats.mean(data))
print("Median:", stats.median(data))
print("Mode:", stats.mode(data))


🔢 Варианты ответа:

A)

Median: 2.5
Mode: 2


B)

Median: 2.5
Mode: 2


C)ValueError: nan is not a valid number


D)

Median: nan
Mode: 2


Правильный ответ: C

💡 Почему?
- Модуль
statistics не умеет работать с NaN.
-
stats.mean() и stats.median() вызовут StatisticsError или ValueError.
- В отличие от
numpy.nanmean, здесь всё падает.
📌 Подвох — в
float('nan') в списке.

BY Machine learning Interview


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/machinelearning_interview/1731

View MORE
Open in Telegram


Machine learning Interview Telegram | DID YOU KNOW?

Date: |

Why Telegram?

Telegram has no known backdoors and, even though it is come in for criticism for using proprietary encryption methods instead of open-source ones, those have yet to be compromised. While no messaging app can guarantee a 100% impermeable defense against determined attackers, Telegram is vulnerabilities are few and either theoretical or based on spoof files fooling users into actively enabling an attack.

Telegram is riding high, adding tens of million of users this year. Now the bill is coming due.Telegram is one of the few significant social-media challengers to Facebook Inc., FB -1.90% on a trajectory toward one billion users active each month by the end of 2022, up from roughly 550 million today.

Machine learning Interview from ca


Telegram Machine learning Interview
FROM USA